/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Loading.java
 *
 * Created on Oct 15, 2011, 3:08:05 PM
 */
package azhar.view;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.UIManager;

/**
 *
 * @author Al-Insan
 */
public class Loading extends javax.swing.JFrame{

    /** Creates new form Loading */
    public Loading() {
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } catch (Exception ex) {
        }
        setIconImage(new ImageIcon(getClass().getResource("images/logo.png")).getImage());
        initComponents();
    }

    public void setValue(int minVal, int max){
        for (int i = minVal; i <= max; i++) {
            pg.setValue(i);
            try {
                Thread.sleep(10);
            } catch (InterruptedException ex) {
                
            }
        }
    }

    public void close(){
        dispose();
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pg = new javax.swing.JProgressBar();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setUndecorated(true);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
        getContentPane().add(pg, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 250, 343, 20));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/azhar/view/images/logo.png"))); // NOI18N
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, 250));

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-344)/2, (screenSize.height-269)/2, 344, 269);
    }// </editor-fold>//GEN-END:initComponents

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JProgressBar pg;
    // End of variables declaration//GEN-END:variables

}
